// router/index.ts
// 1.引入createRouter
import {createRouter, createWebHistory} from 'vue-router'
import Register from '@/page/Register.vue'
import Login from '@/page/Login.vue'
import Home from '@/page/Home.vue'
import Note from "@/components/Note/Note.vue"
import Project from "@/components/Project/Project.vue";
import ProjectInfo from "@/components/Project/ProjectInfo.vue";
import Ics from "@/components/Ics/Ics.vue";
// 2.创建路由器
const router = createRouter({
    history: createWebHistory(),//路由器工作模式
    routes: [
        {
          path:"/",
          redirect: "/home"
        },
        {
            path: "/register",
            component: Register
        }, {
            path: "/login",
            component: Login
        }, {
            path: "/home",
            component: Home,
            children: [
                {
                  path:"/info",
                  component: () => import("@/components/User/Info.vue")
                },
                {
                    path: '/note',
                    component: Note,
                },
                {
                    path: '/project',
                    component: Project,
                },
                {
                    path: '/project-info',
                    component: ProjectInfo
                },
                {
                    path: '/ics',
                    component: Ics
                }, {
                    path: "/IM",
                    component: () => import("@/components/IM/IM.vue")
                }
            ],
        },
        {
            path: "/test",
            component: () => import("@/page/Test.vue")
        }
    ]
})
// 3. 暴露路由器
export default router